<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <title>系统状态</title>
    <link rel="icon" type="image/x-ico" href="../img/nuvoton.ico" />
   <!-- <link type="text/css" href="../jquery/css/redmond/jquery-ui-custom.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css-frames-style.css" />-->
    <script type="text/javascript" src="../jquery/js/jquery.min.js"></script>
    <!-- <script type="text/javascript" src="../jquery/js/jquery-ui-custom.min.js"></script> -->
    <script type="text/javascript" src="js/nuvoton.js"></script>

    <script type="text/javascript">
        //恢复出厂设置按键处理
        function button_process()
        {
            $("#reset_buttton").bind("click",
                    function() {
                        if(confirm("恢复出厂设置会清除所有配置信息，您确定要执行！"))
                        {
                            $.get("system_status.ncgi?doAction=reset",function(data) {
                            })
                        }
                        else
                        {

                        }
                    });
            $("#reboot_buttton").bind("click",
                    function() {
                        if(confirm("您确定要重启系统！"))
                        {
                            $.get("system_status.ncgi?doAction=reboot",function(data) {
                            })
							//window.location.href='reboot_progress_bar.html';
							setTimeout("javascript:location.href='reboot_progress_bar.html'", 50); 
							//location.href = "reboot_progress_bar.html";//location.href实现客户端页面的跳转  
                        }
                        else
                        {

                        }
                    });
        }
        //读取系统状态处理
        function ReadSysStatus()
        {
            $.get("system_status.ncgi?doAction=read", function(data){
                $("#sys_run_status").val(data.STATUS);
                $("#sys_date").val(data.DATE);
                $("#lan_status").val(data.LANSTA);
                $("#wlan0_status").val(data.WLANSTA);
                $("#nrf_ch").val(data.NRFCH);
                $("#lan_inet").val(data.LANINET);
                $("#lan_Bcast").val(data.LANBCAST);
                $("#lan_Mask").val(data.LANMASK);
                $("#wlan0_inet").val(data.WLAN0INET);
                $("#wlan0_Bcast").val(data.WLAN0BCAST);
                $("#wlan0_Mask").val(data.WLAN0MASK);
            });
        }
        $(document).ready(function(){
            ReadSysStatus();
            button_process();
            setInterval("ReadSysStatus()",10000);
        });
    </script>
    <style type="text/css">
        input
        {
            /*background-color:beige;*/
            position:absolute;
            left:300px;
            width:280px;
        }
        .sys_status_info_class
        {
            font-size: 130%;
            width: 80%;
            height: 100%;
        }
        #page_title1
        {
            font-size: 150%;
            //background-color:red;
        }
        body
        {
            /*background-color:slategray;*/
            width: 80%;
            height: 100%;
			color: yellow;
        }
    </style>
</head>
<body>
    <div class="sys_status_info_class">
        <p id="page_title1">系统状态</p>
        <p>
            运行状态:<input id="sys_run_status" type="text" value="运行" disabled="true"/>
        </p>
            系统时间：<input id="sys_date" type="text" value="Thu Sep 17 06:33:27 2015" disabled="true"/>
        </p>

        <p>
            LAN网卡状态:<input id="lan_status" type="text" value="启动" disabled="true"/><br>
            <input id="lan_inet" type="text" value="关闭" disabled="true"/><br>
            <input id="lan_Bcast" type="text" value="关闭" disabled="true"/><br>
            <input id="lan_Mask" type="text" value="关闭" disabled="true"/><br>
        </p>

        <p>
            wlan0网卡状态<input id="wlan0_status" type="text" value="关闭" disabled="true"/><br>
            <input id="wlan0_inet" type="text" value="关闭" disabled="true"/><br>
            <input id="wlan0_Bcast" type="text" value="关闭" disabled="true"/><br>
            <input id="wlan0_Mask" type="text" value="关闭" disabled="true"/><br>

        </p>

        <p>
            2.4G工作频段<input id="nrf_ch" type="text" value="60" disabled="true"/>
        </p>

        <button id="reset_buttton" >恢复出厂设置</button><button id="reboot_buttton" >重启系统</button>
    </div>
</body>
</html>